<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link href="../css/myorder/pay.css" rel="stylesheet">
</head>
<body>
    <div class="main-pay">
        <div class="main-top">
            <div class="header-logo"><a href="#" class="logo"></a></div>
        </div>
        <div class="mian-bottom">
            <div class="bottom-top">
                <p>请在
                    <span id="minute">15:00</span>
                    内后完成支付,超时订单会自动取消
                </p>
            </div>
            <div class="bottom-middle">
                <span>视享电影-订单编号:</span>
                <span>2338219232</span>
                <span class="right-price">38:00</span>
                <span class="right-title">应付金额 ¥</span>
            </div>
            <div class="bottom-bottom">
                <div class="pay-thing">
                    <span>支付宝 :</span>
                    <div class="img-pay"><img src="../images/myorder/pay.svg"></div>
                </div>
                <div class="really-pay">
                    <div class="btn">
                        <span class="right-price">38:00</span>
                        <span class="right-title">支付 ¥</span>
                        <a href="" ><button class="pay-btn">去付款</button></a>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <script>
        // 获取span对象
        var minute = document.getElementById("minute");
        // var time = document.getElementById("second");
        // 设置秒数
        var second = 60*15;
        // 定义秒数显示方式
        function showTime() {
            // 执行1次秒数自减
            second--;
            var andminute = Math.floor(second/60);
            andminute =(parseInt(andminute) < 10? "0" + parseInt(andminute): parseInt(andminute));
            var andsecond = second%60;
            andsecond = "" +(parseInt(andsecond) < 10? "0" + parseInt(andsecond): parseInt(andsecond));
            var time = andminute + ':' + andsecond;
            // 判断，如果秒数小于0则跳转页面
            if (second <= 0){
              //  minute--;
              //  second=60;
              // if(second<0){
                  location.href = "https://www.baidu.com";
              // }
            }
            // 更改span标签的显示内容
            minute.innerHTML = time.toString();
        }
        // 定义定时器，每隔1秒执行一次showTime方法
        setInterval(showTime,1000);
    </script>

</body>
</html>